{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}
	<js href="__PUBLIC__/js/admin/listTable.js"/>
	<js href="__PUBLIC__/js/admin/js.util.js"/>
	<css href="__PUBLIC__/css/admin/common.css"/>
	<js href="__PUBLIC__/js/admin/js.selectzone.js"/>
	
	<css href="__PUBLIC__/css/jquery-ui.css" />
	<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/js/core/plugins.js"/>
{/* import js,css */}
<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<form method="POST" action="bonus.php?act=batch&bonus_type={$smarty.get.bonus_type}" name="listForm">
	<div class="list-div" id="listDiv">
		<table cellpadding="3" cellspacing="1" width="100%">
		<tr>
			<th>
				<input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
				<a href="javascript:listTable.sort('bonus_id'); ">编号</a>{$sort_bonus_id}
			</th>
			<if condition="$show_bonus_sn">
			<th>
				<a href="javascript:listTable.sort('bonus_sn'); ">{$lang.bonus_sn}</a>{$sort_bonus_sn}
			</th>
			</if>
			<th><a href="javascript:listTable.sort('type_name'); ">红包类型</a>{$sort_type_name}</th>
			<th><a href="javascript:listTable.sort('order_id'); ">订单号</a>{$sort_order_id}</th>
			<th><a href="javascript:listTable.sort('user_id'); ">使用会员</a>{$sort_user_id}</th>
			<th><a href="javascript:listTable.sort('used_time'); ">使用时间</a>{$sort_use_time}{$sort_used_time}</th>
			<if condition="$show_mail">
			<th>
				<a href="javascript:listTable.sort('emailed'); ">邮件通知</a>{$sort_emailed}{$sort_emailed}
			</th>
			</if>
			<th>操作</th>
		</tr>
		<volist name="bonus_list" id="bonus">
		<tr>
			<td>
				<span><input value="{$bonus.bonus_id}" name="checkboxes[]" type="checkbox">{$bonus.bonus_id}</span>
			</td>
			<if condition="$show_bonus_sn">
			<td>{$bonus.bonus_sn}</td>
			</if>
			<td>{$bonus.type_name}</td>
			<td>{$bonus.order_sn}</td>
			<td>
				<if condition="$bonus['email']">
					<a href="mailto:{$bonus.email}">{$bonus.user_name}</a>
				<else/>
					{$bonus.user_name}
				</if>
			</td>
			<td align="right">{$bonus.used_time}</td>
			<if condition="$show_mail">
			<td align="center">{$bonus.emailed}</td>
			</if>
			<td align="center">
				<a href="__URL__/remove_bonus?id={$bonus.bonus_id}&bonus_type={$bonus_type}">移除</a>
				<if condition="$show_mail and $bonus['order_id'] eq 0 and $bonus['email']">
					<a href="__URL__/send_mail?bonus_id={$bonus.bonus_id}">发送邮件</a>
				</if>
			</td>
		</tr>
		</volist>
		</table>
		<table cellpadding="4" cellspacing="0">
		<tr>
		<td>
			<input type="hidden" name="bonus_type" value="{$bonus_type}" />
			<input type="submit" name="drop" id="btnSubmit" value="删除" disabled="true" />
				<if condition="$show_mail">
					<input type="submit" name="mail" id="btnSubmit1" value="发送邮件"  disabled="true" />
				</if>
			</td>
			<td align="right"></td>
		</tr>
		</table>
	</div>
</form>

<script type="text/javascript" language="JavaScript">
	onload = function(){
		// 开始检查订单
		//startCheckOrder();
		document.forms['listForm'].reset();
	}
</script>




